package com.demo.spring.annoinit;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Configuration
@PropertySource({"classpath:/db.properties"})
public class DataSourceConfig {
	
	@Value("${jdbc.driver}")
	private String driverClass;
	
	@Bean
	public DataSource dataSource() {
		DataSource dataSource = new DataSource();
		dataSource.setDriverClass(driverClass);
		System.out.println("dataSource exe: " + driverClass);
		return dataSource;
	}
}


